﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Navigation;
using Microsoft.Phone.Controls;
using Microsoft.Phone.Shell;
using Windows.Storage;

namespace APACWP8.View
{
    public partial class SplashScreent : PhoneApplicationPage
    {
        public SplashScreent()
        {
            InitializeComponent();
            this.Loaded += SplashScreent_Loaded;
        }

        void SplashScreent_Loaded(object sender, RoutedEventArgs e)
        {
            if (SettingPage.GetRunFist())
            {
                if (!SettingPage.GetData())
                {
                    App.RootFrame.Navigate(new Uri("/View/MainPage.xaml", UriKind.Relative));
                }
                else
                {
                    App.RootFrame.Navigate(new Uri("/View/StartupPage.xaml", UriKind.Relative));
                }

            }
            else
            {
                App.RootFrame.Navigate(new Uri("/View/StartupPage.xaml", UriKind.Relative));
                SettingPage.SaveData(false);
            }
        }
    }
}